//
//  KCaseDTO.m
//  KutulusLaw
//
//  Created by Mahmood1 on 12/10/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "KCaseDTO.h"

@implementation KCaseDTO
@synthesize poster = _poster, fileVideo = _fileVideo, lastUpdateBy = _lastUpdateBy, lastUpdate = _lastUpdate, lastUpdateText = _lastUpdateText, fileMp4 = _fileMp4;

- (id)init {
    self = [super init];
    if (self) {
		self.poster = @"";	
		self.fileVideo = @"";
		self.lastUpdate = 0;
		self.lastUpdateBy = @"";
		self.lastUpdateText = @"";
		self.fileMp4 = @"";
    }
    return self;
}

- (id)initWithDictionary:(NSDictionary *)dictionary {
    self = [super initWithDictionary:dictionary];
	
    if (self) {
    	
		if ([dictionary objectForKey:kKEY_POSTER]) {
			self.poster = [dictionary objectForKey:kKEY_POSTER] ;
		}
				
		if ([dictionary objectForKey:kKey_FILE_VIDEO]) {
			self.fileVideo = [dictionary objectForKey:kKey_FILE_VIDEO] ;
		}
		
		if ([dictionary objectForKey:kKey_FILE_MP4]) {
			self.fileMp4 = [dictionary objectForKey:kKey_FILE_MP4] ;
		}
		
		if ([dictionary objectForKey:kKEY_LAST_UPDATE]) {
			self.lastUpdate = [[dictionary objectForKey:kKEY_LAST_UPDATE] integerValue];
		}
		
		if ([dictionary objectForKey:kKEY_LAST_UPDATE_BY]) {
			self.lastUpdateBy = [dictionary objectForKey:kKEY_LAST_UPDATE_BY];
		}
		
		if ([dictionary objectForKey:kKEY_LAST_UPDATE_TEXT]) {
			self.lastUpdateText = [dictionary objectForKey:kKEY_LAST_UPDATE_TEXT];
		}
    }
    return self;
}

- (id)copy {
    KCaseDTO *searchFileDTO = [[KCaseDTO alloc] init ];
    if (searchFileDTO) {
       
		searchFileDTO.ID = self.ID;
		searchFileDTO.userID = self.userID;
		searchFileDTO.poster = [self.poster copy];
		searchFileDTO.name = [self.name copy];
		searchFileDTO.postDate = self.postDate;
		searchFileDTO.fileVideo = [self.fileVideo copy];
		searchFileDTO.filePDF = [self.filePDF copy];
		searchFileDTO.lastUpdate = self.lastUpdate;
		searchFileDTO.lastUpdateBy = [self.lastUpdateBy copy];
		searchFileDTO.postDateText= [self.postDateText copy];
		searchFileDTO.lastUpdateText = [self.lastUpdateText copy];
		searchFileDTO.fileMp4 = [self.fileMp4 copy];

    }
    return self;
}

@end
